// 获取 url 查询参数
export function getQueryString() {
  const result: any = {}
  const questString = window.location.search.substring(1) || window.location.hash.split('?')[1]
  const re = /([^&=]+)=([^&]*)/g
  let m: any = ''

  // eslint-disable-next-line no-cond-assign
  while ((m = re.exec(questString))) {
    result[decodeURIComponent(m[1]) as string] = decodeURIComponent(m[2])
  }

  return result
}
